<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>KindEditor 3.2</title>
    <style type="text/css" rel="stylesheet">
      .editor {
      margin-top: 5px;
      margin-bottom: 5px;
      }
    </style>
    <script type="text/javascript" charset="utf-8" src="./../kindeditor.js"></script>
    <script type="text/javascript">
      KE.show({
          id : 'content1',
          cssPath : './index.css'
      });
      function clearEditor(id) {
          KE.g[id].iframeDoc.open();
          KE.g[id].iframeDoc.write(KE.util.getFullHtml(id));
          KE.g[id].iframeDoc.close();
          KE.g[id].newTextarea.value = '';
      }
      function insertHtml(id, html) {
          KE.util.focus(id);
          KE.util.selection(id);
          KE.util.insertHtml(id, html);
      }
    </script>
  </head>
  <body>
    <h3>清空内容,插入内容</h3>
    <div class="editor">
      <textarea id="content1" name="content" style="width:700px;height:400px;visibility:hidden;">
        <strong>月下独酌</strong> - 李白<br /><br />
        花间一壶酒，独酌无相亲。<br /><br />
        举杯邀明月，对影成三人。<br /><br />
        月既不解饮，影徒随我身。<br /><br />
        暂伴月将影，行乐须及春。<br /><br />
        我歌月徘徊，我舞影零乱。<br /><br />
        醒时同交欢，醉后各分散。<br /><br />
        永结无情游，相期邈云汉。<br /><br /></textarea>
    </div>
    <input type="button" name="button" value="清空内容" onclick="javascript:clearEditor('content1');" />
    <input type="button" name="button" value="插入HTML内容" onclick="javascript:insertHtml('content1', '<strong>测试内容</strong>');" />
  </body>
</html>
